package com.vgooo.client.tool.tester;

import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.LinearLayout;

import com.umeng.analytics.MobclickAgent;
import com.vgooo.client.R;

public class TestDisplay extends BaseTestActivity {

	
	final static String KEY = "display";
	
	int key = 0;
	final String[] color = {"#ffffff","#000000","#ff0000","#00ff00","#0000ff"};
	
	LinearLayout display;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		requestWindowFeature(Window.FEATURE_NO_TITLE);

		setContentView(R.layout.test_display);
		init(KEY);
		
		display = (LinearLayout) findViewById(R.id.display);
		display.setBackgroundColor(Color.parseColor(color[key]));
		display.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				if (key == 5) {
					key = 0;
				}
				
				display.setBackgroundColor(Color.parseColor(color[key]));			
				key++;
			}
		});
		
	}
	
	
	
	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		// 友盟统计功能，打开页面
		MobclickAgent.onResume(this);
		super.onResume();
	}
	
	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		// 友盟统计功能，页面关闭
		MobclickAgent.onPause(this);
		super.onPause();
	}

}
